/******************************************************************************
*
* This file is part of FreeTrack (http://code.google.com/p/qtfreetrack).
* BY Willy Gardiol (willy@gardiol.org)
*
* FreeTrack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FreeTrack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Foobar.  If not, see <http://www.gnu.org/licenses/>
*
******************************************************************************/

#ifndef MAINSELECTOR_H
#define MAINSELECTOR_H

#include "IncFreeTrack.h"
#include "freetrackwidget.h"

class FTPushButton;
class FTHelpWidget;
class FTLabel;
class LayerTrack;

class MainSelector : public FreeTrackWidget
{
    Q_OBJECT
public:
    explicit MainSelector(QWidget *parent = 0);

signals:
    // Emitted when the user start/stop the live track
    void liveStatusChange(bool);


private slots:
    void selectLandscape();
    void selectPortrait();
    void selectAutomatic();

private slots:
    // Load a live track from file
    void loadLive();
    // Save live track to file
    void saveLive();
    // Catch tracking start and propagate
    void startRecording(bool);


public slots:
    // User requested to clean the live track deleting all points
    void resetLive();
    // Edit live track
    void editLive();
    // manage tracking
    void changeTracking();


private:
    // Live buttons ares
    FTLabel* live_label;
    FTPushButton* live_start;
    FTPushButton* live_reset;
    FTPushButton* live_load;
    FTPushButton* live_save;
    FTPushButton* live_edit;
    FTHelpWidget* live_help;

    // Gps
    FTPushButton* openGps;
    FTHelpWidget* helpGps;
    // layermanager
    FTPushButton* openLayers;
    FTHelpWidget* helpLayers;
    // table
    FTPushButton* openTable;
    FTHelpWidget* helpTable;

    // about, config, quit, hide
    FTPushButton* openAbout;
    FTPushButton* openConfig;
    FTPushButton* openQuit;
    FTPushButton* openHide;

    FTPushButton* landscape;
    FTPushButton* portrait;
    FTPushButton* automatic;
    FTLabel* labelOrientation;
    FTHelpWidget* helpOrientation;

    QLayout* createHorizontal();
    QLayout* createVertical();

    LayerTrack* livetrack;
};

#endif // MAINSELECTOR_H
